<template>
  <div>
    <div class="return_input">
      <div class="retu" onclick="returns()">
        <img src="../img/121212.png" alt="" />
      </div>
      <div class="inpu">
        <input type="text" placeholder="请输入商家 、商品名称" class="inputs" />
      </div>
      <div class="bor_img"><img src="../img/10101.png" alt="" /></div>
    </div>
    <div class="saerch_history">
      <div class="p_history">
        历史搜索
      </div>
      <div class="delete_img">
        <img src="../img/123466.png" alt="" class="icon" />
        <div class="bottom_box">
          <div class="bottom_left">清空</div>
          <div class="bottom_right">完成</div>
        </div>
      </div>
    </div>
    <div class="saerch_content">

    </div>


    <div class="saerch_history">
      <div class="p_history">
        热门搜索
      </div>

    </div>
    <div class="saerch_contents">

    </div>
    <div class="all_com">

    </div>

  </div>
</template>

<script setup>
import { ref } from 'vue';
import { useRouter } from 'vue-router';

// 关键：创建路由实例
const router = useRouter();

const register = () => {
  // 现在可以使用 router 实例了
  router.push('/search');
};
</script>

<style scoped>
* {
  margin: 0;
  padding: 0;
}

body {

  font-family: "PingFang SC", "Microsoft YaHei", "微软雅黑", "Microsoft JhengHei", "黑体", arial, STHeiti, '\5b8b\4f53';
  background-color: #fafafa;
}

/* top */
.return_input {
  width: 100%;
  height: 50px;
  display: flex;
  align-items: center;
  background-color: white;
}

.inpu {
  width: 75%;
  margin-top: 9px;
  height: 100%;
  padding-top: 12.5px;
}

input {
  width: 95%;
  height: 25px;
  text-indent: 15px;
  border: #aeaeae 1px solid;
  border-radius: 15px;
}

.bot_img {
  height: 100%;
}

.bot_img img {
  width: 15px;
}

input::placeholder {
  text-indent: 15px;
  color: #aeaeae;
}

/* 历史搜索 */
.saerch_history {
  margin-top: 40px;
  position: relative;
  width: 92%;
  display: flex;
  margin-left: 4%;
  justify-content: space-between;
}

.p_history {
  font-weight: 500;
  font-size: 14px;
}

.delete_img {
  width: 15px;
}

.delete_img img {
  width: 100%;
  height: 16px;
}

.saerch_content {
  width: 100%;

  display: flex;
  flex-wrap: wrap;
  margin-top: 25px;
}

.saerch_contents {
  width: 100%;
  height: 50px;
  display: flex;
  flex-wrap: wrap;
  margin-top: 25px;
}

.contents {
  padding-left: 15px;
  padding-right: 15px;
  margin-left: 15px;
  margin-top: 5px;
  height: 25px;
  border-radius: 12px;
  background-color: white;
  position: relative;
  line-height: 25px;
  text-align: center;
  color: #878787;
  font-size: 13px;
}

.img1 {
  position: absolute;
  top: -6px;
  right: -7px;
  display: none;
}

.img1 img {
  width: 18px;
}

.saerch_contents {
  width: 100%;
  height: 50px;
  display: flex;

  margin-top: 25px;
}

.content {
  width: 50px;
  margin-left: 15px;
  margin-top: 10px;
  height: 25px;
  border-radius: 12px;
  background-color: white;
  line-height: 25px;
  text-align: center;
  color: #878787;
  font-size: 13px;
}

.saerch_content p {
  margin-left: 40%;
  color: #878787;
}

.err {
  padding: 5px;
  height: 25px;
  background-color: #fef0f0;
  position: fixed;
  text-align: center;
  line-height: 25px;
  border-radius: 8px;
  display: none;

  top: 5%;
  left: 30%;
  border: 1px solid #f56d6d;
  color: #f67979;
}

.bottom_box {
  display: flex;
  position: absolute;
  top: 0%;
  right: 5px;
}

.bottom_left {
  display: none;
  width: 40px;
  text-align: center;
  background-color: #fef0f0;
  color: #f67979;
  border: #fc5d58 1px solid;
  border-radius: 5px;
}

.bottom_right {
  display: none;
  width: 40px;
  margin-left: 10px;
  text-align: center;
  background-color: white;
  color: #8f8f8f;
  border: #8f8f8f 1px solid;
  border-radius: 5px;
}

.all_com {
  width: 92%;
  margin-left: 4%;
  column-count: 2;
  column-gap: 0;
  margin-bottom: 20px;
  margin-top: 30px;
}

.com {
  width: 95%;
  break-inside: avoid;
  padding-top: 1px;
  background-color: white;
  margin-bottom: 10px;
}

.com_img {
  width: 92%;
  margin-left: 4%;
  margin-top: 15px;
}

.com_img img {
  width: 100%;
  border-radius: 5px;
}

.com_text {
  color: #606360;
  font-size: 14px;
  width: 92%;
  margin-left: 4%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.com_texts {
  font-size: 12px;
  color: rgba(139, 141, 140, 1);
  width: 92%;
  margin-left: 4%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.com_price {
  width: 92%;
  margin-left: 4%;
}
</style>